package com.huawei.hwid.core.datatype;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.text.TextUtils;
import com.huawei.hwid.core.d.m;
import com.huawei.hwid.core.encrypt.e;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class DeviceInfo implements Parcelable {
    public static final Creator<DeviceInfo> CREATOR = new Creator<DeviceInfo>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return a(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return a(i);
        }

        public DeviceInfo a(Parcel parcel) {
            DeviceInfo deviceInfo = new DeviceInfo();
            deviceInfo.b = parcel.readString();
            deviceInfo.d = parcel.readString();
            deviceInfo.a = parcel.readString();
            deviceInfo.c = parcel.readString();
            deviceInfo.e = parcel.readString();
            deviceInfo.f = parcel.readString();
            deviceInfo.g = parcel.readString();
            return deviceInfo;
        }

        public DeviceInfo[] a(int i) {
            return new DeviceInfo[i];
        }
    };
    public static final String TAG_DEVICE_ALIASNAME = "deviceAliasName";
    public static final String TAG_DEVICE_FREQUENTLYUSED = "frequentlyUsed";
    public static final String TAG_DEVICE_ID = "deviceID";
    public static final String TAG_DEVICE_INFO = "deviceInfo";
    public static final String TAG_DEVICE_INFO_LIST = "deviceIDList";
    public static final String TAG_DEVICE_LOGINTIME = "loginTime";
    public static final String TAG_DEVICE_LOGOUTTIME = "logoutTime";
    public static final String TAG_DEVICE_TYPE = "deviceType";
    public static final String TAG_TERMINALTYPE = "terminalType";
    public static final String TAG_UUID = "uuid";
    private String a;
    private String b;
    private String c;
    private String d;
    private String e;
    private String f;
    private String g = "";

    public DeviceInfo(String str, String str2, String str3) {
        this.a = str;
        this.b = str2;
        this.c = str3;
    }

    public static void getDeviceInfoInTag(XmlPullParser xmlPullParser, DeviceInfo deviceInfo, String str) throws XmlPullParserException, IOException {
        if (xmlPullParser != null && deviceInfo != null && str != null) {
            if (TAG_DEVICE_ID.equals(str)) {
                deviceInfo.setDeviceIdInDeviceInfo(xmlPullParser.nextText());
            } else if ("deviceType".equals(str)) {
                deviceInfo.setDeviceType(xmlPullParser.nextText());
            } else if ("terminalType".equals(str)) {
                deviceInfo.setTerminalType(xmlPullParser.nextText());
            } else if (TAG_DEVICE_ALIASNAME.equals(str)) {
                deviceInfo.setDeviceAliasName(xmlPullParser.nextText());
            } else if (TAG_DEVICE_LOGINTIME.equals(str)) {
                deviceInfo.setmLoginTime(xmlPullParser.nextText());
            } else if (TAG_DEVICE_LOGOUTTIME.equals(str)) {
                deviceInfo.setmLogoutTime(xmlPullParser.nextText());
            } else if (TAG_DEVICE_FREQUENTLYUSED.equals(str)) {
                deviceInfo.setmFrequentlyUsed(xmlPullParser.nextText());
            }
        }
    }

    public void setDeviceIdInDeviceInfo(String str) {
        this.b = str;
    }

    public String getDeviceId() {
        return this.b;
    }

    public String getTerminalType() {
        return this.c;
    }

    public void setTerminalType(String str) {
        this.c = str;
    }

    public String getDeviceType() {
        return this.a;
    }

    public void setDeviceType(String str) {
        this.a = str;
    }

    public String getDeviceAliasName() {
        return this.d;
    }

    public void setDeviceAliasName(String str) {
        this.d = str;
    }

    public int describeContents() {
        return 0;
    }

    public String getmLoginTime() {
        return this.e;
    }

    public void setmLoginTime(String str) {
        this.e = str;
    }

    public String getmLogoutTime() {
        return this.f;
    }

    public void setmLogoutTime(String str) {
        this.f = str;
    }

    public String getmFrequentlyUsed() {
        return this.g;
    }

    public void setmFrequentlyUsed(String str) {
        this.g = str;
    }

    public boolean isLogin() {
        if (TextUtils.isEmpty(this.f) && !TextUtils.isEmpty(this.e)) {
            return true;
        }
        return false;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.b);
        parcel.writeString(this.d);
        parcel.writeString(this.a);
        parcel.writeString(this.c);
        parcel.writeString(this.e);
        parcel.writeString(this.f);
        parcel.writeString(this.g);
    }

    public boolean isObjectEquals(Object obj) {
        if (obj == null || !(obj instanceof DeviceInfo)) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        DeviceInfo deviceInfo = (DeviceInfo) obj;
        if (m.b(this.d, deviceInfo.d) && m.b(this.b, deviceInfo.b) && m.b(this.c, deviceInfo.c) && m.b(this.a, deviceInfo.a)) {
            return true;
        }
        return false;
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("{'mDeviceAliasName':");
        stringBuilder.append(e.a(this.d));
        stringBuilder.append(",'mDeviceId':");
        stringBuilder.append(e.a(this.b));
        stringBuilder.append(",'mTerminalType':");
        stringBuilder.append(this.c);
        stringBuilder.append(",'mDeviceType':");
        stringBuilder.append(this.a);
        stringBuilder.append(",'mLoginTime':");
        stringBuilder.append(this.e);
        stringBuilder.append(",'mLogoutTime':");
        stringBuilder.append(this.f);
        stringBuilder.append(",'mFrequentlyUsed':");
        stringBuilder.append(this.g);
        stringBuilder.append("}");
        return stringBuilder.toString();
    }
}
